package com.nengchuan.eic.nceconomy.constant;

import java.util.stream.Stream;

/**
 * 功能描述:
 *
 * @Author: liurui
 * @Date: 2020/4/23 0023 下午 6:51
 */
public enum ProjectEnum {
    POWER_TRANSFORMATION ("变电","POWER_TRANSFORMATION",1),
    CIRCUIT("线路","CIRCUIT",3),
    OTHER("","",null);

    public String text;
    public String code;
    public Integer interCode;

    ProjectEnum(String text,String code,Integer interCode) {
        this.text = text;
        this.code = code;
        this.interCode = interCode;
    }
    public String getText() {
        return text;
    }
    public String getCode() {
        return code;
    }
    public Integer getInterCode() {
        return interCode;
    }

    public static String getCodeByInterCode(Integer interCode){
        return Stream.of(ProjectEnum.values()).filter(x->x.getInterCode().equals(interCode)).findFirst().orElse(OTHER).getCode();
    }

}
